package ${classPath};

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

/**
 * 
 * @author APPLE
 *
 */

<#assign instance="${domain?substring(0,1)?lower_case}${domain?substring(1)}"/>
@Data
@ToString
public class ${domain}AddBo {

<#list fieldList as field>
  

<#compress>
  /** ${field.comment} */
  <#if field.name!="id"><#list field.annotations as annotation> <#--内层循环-->
  <#if !annotation?starts_with("@Co")&&!annotation?starts_with("@En")>
    ${annotation}
  </#if>
</#list>
</#if>
  private ${field.type} ${field.name};
</#compress>
</#list>


  public ${domain} build() {
    ${domain} ${instance} = new ${domain}();
    
    <#list fieldList as field>
      //${field.comment}
      ${instance}.set${field.name?cap_first}(${field.name});
    </#list>
    return ${instance};
  }
}

<#--
 ${annotation?substring(annotation?last_index_of("length")+7)}
 ${annotation?substring(annotation?last_index_of("length")+7)?substring(0,annotation?last_index_of(","))}
 -->